package oop;

public class Demo_Abstract_Teacher {
    public static void main(String[] args) {
        ChineseTeacher chineseTeacher = new ChineseTeacher("wzx",25);
        System.out.println(chineseTeacher);
    }
}
abstract class Teacher {
    private String name;
    private int age;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Teacher{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    public Teacher() {
    }

    public Teacher(String name, int age) {
        this.name = name;
        this.age = age;
    }

    abstract void teach();
}
class ChineseTeacher extends Teacher {


    public ChineseTeacher() {
        super();
    }

    public ChineseTeacher(String name, int age) {
        super(name, age);
    }

    @Override
    void teach() {
        System.out.println("我的姓名是："+getName()+"我的年龄是："+getAge()+"教语文");
    }
}
